/*
 * @Author: szx
 * @Date: 2022-02-24 13:02:06
 * @LastEditTime: 2022-02-24 13:05:09
 * @Description:
 * @FilePath: \leetcode\200-299\242\242_2.js
 */
/**
 * @param {string} s
 * @param {string} t
 * @return {boolean}
 */
var isAnagram = function (s, t) {
    if (s.length != t.length) return false;
    const arr = new Array(26).fill(0);
    for (let i = 0; i < s.length; i++) {
        arr[s.charCodeAt(i) - 65]++;
        arr[t.charCodeAt(i) - 65]--;
    }
    for (let i of arr) if (i != 0) return false;
    return true;
};
